// Copyright 2022 jeff.li. and/or its affiliates.


#include <tbir/runtime/container.h>
#include <tbir/runtime/container_private.h>
#include <tbir/runtime/ft_container.h>
#include <tbir/runtime/registry.h>

namespace tbir::runtime {

/******************************************************************************
 * File container
 *****************************************************************************/
    TBIR_REGISTER_GLOBAL("runtime.File")
    .set_body_typed([](const Unicode &path, const Unicode &mode, const Unicode &encoding) {
        return File(path, mode, encoding);
    });

    TBIR_REGISTER_GLOBAL("runtime.FileHasNext").set_body_typed([](const File &file) {
        return file.HasNext();
    });

    TBIR_REGISTER_GLOBAL("runtime.FileReadLineString").set_body_typed([](const File &file) {
        return file.ReadLineString();
    });

    TBIR_REGISTER_GLOBAL("runtime.FileReadLineUnicode").set_body_typed([](const File &file) {
        return file.ReadLineUnicode();
    });

}  // namespace tbir::runtime
